﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
using Telerik.Web.UI;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GFMS.APP.App_UI.UserControls
{
    public partial class user : System.Web.UI.UserControl
    {
        private IEmployeeBLL empBLL = new EmployeeBLL();
        private SsMng ssMng = new SsMng();
        private void Page_Load(object sender, EventArgs e)
        {
            
        }
        protected bool IsUserControlPostBack
        {
            get
            {
                return this.ViewState["IsUserControlPostBack"] != null;
            }
        }
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            if (!IsUserControlPostBack)
            {
	            
                DataRowCollection drc;
                drc = empBLL.LoadEmployees(ssMng.EmpSeqI, "", true, "").Tables[0].Rows;
                
                if (drc.Count > 0)
                    lblUserName.Text = "คุณ" + drc[0]["first_name"].ToString();
                else
                    lblUserName.Text = "";

                this.ViewState.Add("IsUserControlPostBack", true);
            }
        }


    }
}